<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
 <head>
  <title>Dynamic handling of combinators</title>
  <style type="text/css">
   #test { background: red; display: block; padding: 1em; }
   #stub ~ div div + div > div { background: lime; }
</style>
  <link rel="first" href="css3-modsel-1.html" title="Groups of selectors">
  <link rel="prev" href="css3-modsel-d1b.html" title="Dynamic handling of :empty">
  <link rel="next" href="css3-modsel-d4.html" title="Dynamic updating of :first-child and :last-child">
  <link rel="last" href="css3-modsel-d4.html" title="Dynamic updating of :first-child and :last-child">
  <link rel="up" href="./index.html">
  <link rel="top" href="../../index.html">
 </head>
 <body>

 <div>

  

  
  <script type="text/javascript">
   

    function test() {
      el = document.getElementById('test');
      el.parentNode.parentNode.insertBefore(document.createElement('div'), el.parentNode);
    }

    window.setTimeout("test()", 100);
   
  </script>
  

  <p> The following bar should be green. </p>

  <div id="stub"></div>
  <div></div>
  <div><div><!-- <div/> --><div><div id="test"></div></div></div></div>

 </div>

</body>
</html>